package com.harvest.scientific.ladder.page.ui.main

import BaseResponse
import android.os.Parcel
import android.os.Parcelable
import com.harvest.scientific.ladder.base.BaModel
import com.harvest.scientific.ladder.net.BaRsitory
import com.harvest.scientific.ladder.net.ComParams
import com.harvest.scientific.ladder.net.toRespArray
import com.harvest.scientific.ladder.net.toRespObj

/**
 * @author：zenglingwen
 * @date：2024-06-08 21:50
 * @desc：
 */

data class TightBlueEyesightData(val tightBlueEyesight: String)


data class InjurePacificChickenRes(
    val hardworkingClassmateDarkCrossroads: String = "",
    val horribleQuickBoy: Int = -1,
    val latestKindergartenIncome: Int = -1,
    val mostEndlessComfortableLightning: String = "",
    val prettyCrazyHerb: Double = 0.0,
    val prettyManMarble: String = "",
    val splendidRareAirmailHamburger: String = ""
) : BaModel(), Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString() ?: "",
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString() ?: "",
        parcel.readDouble(),
        parcel.readString() ?: "",
        parcel.readString() ?: ""
    ) {


    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(hardworkingClassmateDarkCrossroads)
        parcel.writeInt(horribleQuickBoy)
        parcel.writeInt(latestKindergartenIncome)
        parcel.writeString(mostEndlessComfortableLightning)
        parcel.writeDouble(prettyCrazyHerb)
        parcel.writeString(prettyManMarble)
        parcel.writeString(splendidRareAirmailHamburger)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<InjurePacificChickenRes> {
        override fun createFromParcel(parcel: Parcel): InjurePacificChickenRes {
            return InjurePacificChickenRes(parcel)
        }

        override fun newArray(size: Int): Array<InjurePacificChickenRes?> {
            return arrayOfNulls(size)
        }
    }
}

data class DislikeRoughSpeRes(
    val bothPondUnimportantChimneyGuide: Int? = 0,
    val eastContainer: String? = "",
    val fullEasternGardenDouble: Int? = 0,
    val gentleBoyActualTailor: Int? = 0,
    val latestKindergartenIncome: Int? = 0,
    val magicBrotherhoodAllFlame: String = "",
    val magicNeckCourtConceitedLaughter: Int? = 0,
    val narrowFuelHealthyMemoryLibrarian: String = "",
    val privateCelebrationCubicSilkMessyHydrogen: String = "",
    val rainyYouSmallUsualBasket: Int? = 0,
    val religiousFlightAugustExactSmog: Int? = 0,
    val rightPasserCivilRainbow: String = "",
    val vastAnotherMemory: String = ""
)

class MainRepository : BaRsitory() {


    suspend fun queryAppSettings(key: String): BaseResponse<Any?> {
        return handleRequest {
            baseService.deleteContraryMonkey(
                ComParams.getCommonParams()
                    .toMutableMap()
                    .apply {
                        put("crazyRawUserMetalDentist", key)
                    }).toRespObj(Any::class.java)
        }
    }

    suspend fun queryInjurePacificChicken(): BaseResponse<List<InjurePacificChickenRes>> {
        return handleRequest {
            baseService.injurePacificChicken(ComParams.getCommonParams().toMutableMap())
                .toRespArray(InjurePacificChickenRes::class.java)
        }
    }

    suspend fun dislikeRoughSpear(): BaseResponse<DislikeRoughSpeRes?> {
        return handleRequest {
            baseService.dislikeRoughSpear(ComParams.getCommonParams().toMutableMap())
                .toRespObj(DislikeRoughSpeRes::class.java)
        }
    }

//    suspend fun  loseGrandComfort(): BaseResponse<LoseGrandComfortRes?> {
//        return handleRequest {
//            baseService.loseGrandComfort(ComParams.getCommonParams().toMutableMap().apply {
//                put("undergroundMedicalPlayroomProfessor", "1")
//            }).toRespObj(LoseGrandComfortRes::class.java)
//        }
//    }
}